<!DOCTYPE html>



  


<html class="theme-next muse use-motion" lang="">
<head><meta name="generator" content="Hexo 3.8.0">
  <meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="theme-color" content="#222">









<meta http-equiv="Cache-Control" content="no-transform">
<meta http-equiv="Cache-Control" content="no-siteapp">
















  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css">







<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css">

<link href="/css/main.css?v=5.1.4" rel="stylesheet" type="text/css">


  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon.ico?v=5.1.4">


  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png?v=5.1.4">


  <link rel="mask-icon" href="/images/logo.svg?v=5.1.4" color="#222">





  <meta name="keywords" content="Hexo, NexT">










<meta property="og:type" content="website">
<meta property="og:title" content="Blog">
<meta property="og:url" content="http://yoursite.com/index.html">
<meta property="og:site_name" content="Blog">
<meta property="og:locale" content="default">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Blog">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Muse',
    version: '5.1.4',
    sidebar: {"position":"left","display":"post","offset":12,"b2t":false,"scrollpercent":false,"onmobile":false},
    fancybox: true,
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    duoshuo: {
      userId: '0',
      author: 'Author'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="http://yoursite.com/">





<!-- 添加顶部加载条 -->
<script src="//cdn.bootcss.com/pace/1.0.2/pace.min.js"></script>
<link href="//cdn.bootcss.com/pace/1.0.2/themes/pink/pace-theme-flash.css" rel="stylesheet">
<style>
    .pace .pace-progress {
        background: #1E92FB; /*进度条颜色*/
        height: 3px;
    }
    .pace .pace-progress-inner {
         box-shadow: 0 0 10px #1E92FB, 0 0 5px     #1E92FB; /*阴影颜色*/
    }
    .pace .pace-activity {
        border-top-color: #1E92FB;    /*上边框颜色*/
        border-left-color: #1E92FB;    /*左边框颜色*/
    }
</style>
  <title>Blog</title>
  








</head>

<body itemscope="" itemtype="http://schema.org/WebPage" lang="default">

  
  
    
  

  <div class="container sidebar-position-left 
  page-home">
    <div class="headband">
			<a href="https://github.com/RocGit">
				<img style="position: absolute; top: 0; left: 0; border: 0;" src="https://s3.amazonaws.com/github/ribbons/forkme_left_gray_6d6d6d.png" alt="Fork me on GitHub"></a>
		</div>

    <header id="header" class="header" itemscope="" itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/" class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">Blog</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle"></p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br>
            
            Home
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br>
            
            Tags
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/categories/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th"></i> <br>
            
            Categories
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br>
            
            Archives
          </a>
        </li>
      
        
        <li class="menu-item menu-item-about">
          <a href="/about/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-user"></i> <br>
            
            About
          </a>
        </li>
      
        
        <li class="menu-item menu-item-blogdiy">
          <a href="/BlogDIY" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-angellist"></i> <br>
            
            BlogDIY
          </a>
        </li>
      

      
    </ul>
  

  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            
  <section id="posts" class="posts-expand">
    
      

  

  
  
  

  <article class="post post-type-normal" itemscope="" itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="http://yoursite.com/2019/01/30/Open-Source/">

    <span hidden itemprop="author" itemscope="" itemtype="http://schema.org/Person">
      <meta itemprop="name" content="Roc">
      <meta itemprop="description" content="">
      <meta itemprop="image" content="/images/default_avatar.png">
    </span>

    <span hidden itemprop="publisher" itemscope="" itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Blog">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">
                
                <a class="post-title-link" href="/2019/01/30/Open-Source/" itemprop="url">About Open Source And Copyright</a></h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">Posted on</span>
              
              <time title="Post created" itemprop="dateCreated datePublished" datetime="2019-01-30T15:45:36+08:00">
                2019-01-30
              </time>
            

            

            
          </span>

          

          
            
          

          
          

          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        
          
            <h3 id="1-开源软件协议"><a href="#1-开源软件协议" class="headerlink" title="1.开源软件协议"></a>1.开源软件协议</h3><h5 id="GitHub-用了很长时间了，open-source也fork了不少，但是对于开源软件协议不甚了解，于是就学习一下，加深印象，感谢强大的互联网和各位大神。"><a href="#GitHub-用了很长时间了，open-source也fork了不少，但是对于开源软件协议不甚了解，于是就学习一下，加深印象，感谢强大的互联网和各位大神。" class="headerlink" title="GitHub 用了很长时间了，open source也fork了不少，但是对于开源软件协议不甚了解，于是就学习一下，加深印象，感谢强大的互联网和各位大神。"></a>GitHub 用了很长时间了，open source也fork了不少，但是对于开源软件协议不甚了解，于是就学习一下，加深印象，感谢强大的互联网和各位大神。</h5><h5 id="借用阮一峰老师的图Mark一下，以备参考：六种流行开源协议的使用区分"><a href="#借用阮一峰老师的图Mark一下，以备参考：六种流行开源协议的使用区分" class="headerlink" title="借用阮一峰老师的图Mark一下，以备参考：六种流行开源协议的使用区分"></a>借用阮一峰老师的图Mark一下，以备参考：六种流行开源协议的使用区分</h5><p><img src="/2019/01/30/Open-Source/1.jpg" alt="六种流行开源协议的使用区分"><br><img src="/2019/01/30/Open-Source/2.jpg" alt="三种简明"></p>
<p><a href="http://choosealicense.online/">选择一个开源软件协议-中文</a>（感谢<a href="http://www.gcssloop.com">GcsSloop</a>）</p>
<p><a href="https://choosealicense.com/">Choose an open source license</a></p>
<h3 id="2-知识共享"><a href="#2-知识共享" class="headerlink" title="2.知识共享"></a>2.知识共享</h3><h4 id="Creative-Commons，简称CC。-是一个非营利组织，也是一种创作的授权方式。"><a href="#Creative-Commons，简称CC。-是一个非营利组织，也是一种创作的授权方式。" class="headerlink" title="Creative Commons，简称CC。 是一个非营利组织，也是一种创作的授权方式。"></a>Creative Commons，简称CC。 是一个非营利组织，也是一种创作的授权方式。</h4><blockquote>
<p>传统的著作权通常为两种极端，一端是“保留所有权利”，另一端则是“不保留任何权利”（即公有领域，public domain）。<br>知识共享则试图在两者中间广大的灰色地带保有弹性，使得创作者可以“保留部分权利”。知识共享提供多种可供选择的授权形式及条款组合，<br>创作者可与大众分享创作，授予其他人再散布的权利，却又能保留其他某些权利。知识共享的诞生是为了避免现代知识产权以及版权法在信息共享方面的问题。</p>
</blockquote>
<h4 id="一般用于设计，摄影，图片作品的开放式分享。"><a href="#一般用于设计，摄影，图片作品的开放式分享。" class="headerlink" title="一般用于设计，摄影，图片作品的开放式分享。"></a>一般用于设计，摄影，图片作品的开放式分享。</h4><blockquote>
<p>作为作者，你可以选择以下1~4种权利组合:</p>
<ol>
<li>署名（Attribution，简写为BY）：必须提到原作者。</li>
<li>非商业用途（Noncommercial，简写为NC）：不得用于盈利性目的。</li>
<li>禁止演绎（No Derivative Works，简写为ND）：不得修改原作品, 不得再创作。</li>
<li>相同方式共享（Share Alike，简写为SA）：允许修改原作品，但必须使用相同的许可证发布。<br><img src="/2019/01/30/Open-Source/3.jpg" alt="权利组合"> 来自百度百科</li>
</ol>
</blockquote>
<h4 id="简化6种协议组合"><a href="#简化6种协议组合" class="headerlink" title="简化6种协议组合"></a>简化6种协议组合</h4><blockquote>
<ol>
<li>署名（BY）</li>
<li>署名（BY）-相同方式共享（SA）</li>
<li>署名（BY）-禁止演绎（ND）</li>
<li>署名（BY）-非商业性使用（NC）</li>
<li>署名（BY）-非商业性使用（NC）-相同方式共享（SA）</li>
<li>署名（BY）-非商业性使用（NC）-禁止演绎（ND）<br>在最新Creative Commons（知识共享）3.0协议中，署名(BY)权利成为必选项。<br><img src="/2019/01/30/Open-Source/4.jpg" alt="6种协议组合"> 来自百度百科</li>
</ol>
</blockquote>
<p><a href="https://creativecommons.org/">CreativeCommons</a><br><a href="https://creativecommons.org/licenses/by/3.0/cn/">署名 3.0 中国大陆 (CC BY 3.0 CN)</a></p>

          
        
      
    </div>
    
    
    

    

    

    

    <footer class="post-footer">
      

      

      

      
      
        <div class="post-eof"></div>
      
    </footer>
  </div>
  
  
  
  </article>


    
      

  

  
  
  

  <article class="post post-type-normal" itemscope="" itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="http://yoursite.com/2018/12/14/pip-awscli-install-win7/">

    <span hidden itemprop="author" itemscope="" itemtype="http://schema.org/Person">
      <meta itemprop="name" content="Roc">
      <meta itemprop="description" content="">
      <meta itemprop="image" content="/images/default_avatar.png">
    </span>

    <span hidden itemprop="publisher" itemscope="" itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Blog">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">
                
                <a class="post-title-link" href="/2018/12/14/pip-awscli-install-win7/" itemprop="url">Windows下安装pip，通过pip安装aws-cli</a></h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">Posted on</span>
              
              <time title="Post created" itemprop="dateCreated datePublished" datetime="2018-12-14T10:52:02+08:00">
                2018-12-14
              </time>
            

            

            
          </span>

          

          
            
          

          
          

          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        
          
            <h3 id="Python环境"><a href="#Python环境" class="headerlink" title="Python环境"></a>Python环境</h3><p>pip依赖于Python,我机器Win7 64位已经安装了Python3，并添加了环境变量：</p>
<p><code>PYTHON_HOME : E:\temp\Python36</code><br><code>Path : %PYTHON_HOME%;%PYTHON_HOME%\Tools\Scripts;%PYTHON_HOME%\Scripts;</code></p>
<p><a href="https://www.python.org/downloads/">Python Downloads</a> <img src="https://www.python.org/static/img/python-logo.png" alt="cmd-markdown-logo"></p>
<p>Python 2 &gt;=2.7.9 Python3 &gt;=3.4 版本安装好以后根目录下Scripts文件夹里有pip，只需升级一下即可，其他版本则需要安装pip。</p>
<h3 id="升级Pip包"><a href="#升级Pip包" class="headerlink" title="升级Pip包"></a>升级Pip包</h3><p><code>python -m pip install -U pip</code></p>
<p>如图：<img src="/2018/12/14/pip-awscli-install-win7/1.jpg" alt="update"></p>
<h3 id="安装PIP包"><a href="#安装PIP包" class="headerlink" title="安装PIP包"></a>安装PIP包</h3><p>到<a href="https://pypi.org/">Python Package Index</a> 搜索 pip，下载最新版pip包<br>如图：<img src="/2018/12/14/pip-awscli-install-win7/2.jpg" alt="dld"></p>
<p>用常规的解压工具解压pip-18.1.tar.gz,进入到pip的解压目录，CMD执行<code>python setup.py install</code>进行安装<br>如图：<img src="/2018/12/14/pip-awscli-install-win7/3.jpg" alt="ok"></p>
<p>因为pip命令被安装到Python根目录的Scripts文件夹下，如果没有添加环境变量的则需要添加<code>Path : %PYTHON_HOME%\Scripts;</code> ，CMD执行<code>pip list</code><br>如图：<img src="/2018/12/14/pip-awscli-install-win7/4.jpg" alt="pip list"></p>
<p>安装pip成功，则可以通过pip命令安装其他的python模块了。</p>
<h3 id="安装AWS-CLI"><a href="#安装AWS-CLI" class="headerlink" title="安装AWS CLI"></a>安装AWS CLI</h3><p>CMD执行<code>pip install awscli</code><br>如图：<img src="/2018/12/14/pip-awscli-install-win7/5.jpg" alt="awscli"></p>
<p>CMD执行<code>pip list</code><br>如图：<img src="/2018/12/14/pip-awscli-install-win7/6.jpg" alt="pip l"></p>
<p>CMD执行<code>aws --version</code><br>如图：<img src="/2018/12/14/pip-awscli-install-win7/7.jpg" alt="aws v"></p>
<p>这样aws-cli就装好了.</p>
<h3 id="更新到最新版本的-AWS-CLI"><a href="#更新到最新版本的-AWS-CLI" class="headerlink" title="更新到最新版本的 AWS CLI"></a>更新到最新版本的 AWS CLI</h3><p><code>pip install awscli --upgrade --user</code><br>如图：<img src="/2018/12/14/pip-awscli-install-win7/8.jpg" alt="upd ac"></p>
<h3 id="卸载-AWS-CLI"><a href="#卸载-AWS-CLI" class="headerlink" title="卸载 AWS CLI"></a>卸载 AWS CLI</h3><p><code>pip uninstall awscli</code></p>
<p><a href="https://github.com/aws/aws-cli">AWS CLI Github</a></p>

          
        
      
    </div>
    
    
    

    

    

    

    <footer class="post-footer">
      

      

      

      
      
        <div class="post-eof"></div>
      
    </footer>
  </div>
  
  
  
  </article>


    
      

  

  
  
  

  <article class="post post-type-normal" itemscope="" itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="http://yoursite.com/2018/12/12/React-Practice-Deposit/">

    <span hidden itemprop="author" itemscope="" itemtype="http://schema.org/Person">
      <meta itemprop="name" content="Roc">
      <meta itemprop="description" content="">
      <meta itemprop="image" content="/images/default_avatar.png">
    </span>

    <span hidden itemprop="publisher" itemscope="" itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Blog">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">
                
                <a class="post-title-link" href="/2018/12/12/React-Practice-Deposit/" itemprop="url">React Practice Deposit</a></h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">Posted on</span>
              
              <time title="Post created" itemprop="dateCreated datePublished" datetime="2018-12-12T11:07:57+08:00">
                2018-12-12
              </time>
            

            

            
          </span>

          

          
            
          

          
          

          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        
          
            <h3 id="React-createClass与React-Component区别"><a href="#React-createClass与React-Component区别" class="headerlink" title="React.createClass与React.Component区别"></a>React.createClass与React.Component区别</h3><h4 id="this自绑定"><a href="#this自绑定" class="headerlink" title="this自绑定"></a><code>this</code>自绑定</h4><p>  <code>React.createClass</code>创建的组件，其每一个成员函数的<code>this</code>都有React自动绑定，任何时候使用，直接使用<code>this.method</code>即可，函数中的<code>this</code>会被正确设置。<br>    <figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">const</span> Clazz = React.createClass(&#123;  </span><br><span class="line">	handleClick() &#123;</span><br><span class="line">		<span class="built_in">console</span>.log(<span class="keyword">this</span>); <span class="comment">// React Component instance</span></span><br><span class="line">	&#125;,</span><br><span class="line">	render() &#123;</span><br><span class="line">		<span class="keyword">return</span> (</span><br><span class="line">			&lt;div onClick=&#123;<span class="keyword">this</span>.handleClick&#125;&gt;&lt;/div&gt;</span><br><span class="line">		);</span><br><span class="line">	&#125;</span><br><span class="line"> &#125;);</span><br></pre></td></tr></table></figure></p>
<p>  <code>React.Component</code>创建的组件，其成员函数不会自动绑定<code>this</code>，需要开发者手动绑定，否则<code>this</code>不能获取当前组件实例对象。<br>    <figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><span class="line"><span class="class"><span class="keyword">class</span> <span class="title">Clazz</span> <span class="keyword">extends</span> <span class="title">React</span>.<span class="title">Component</span> </span>&#123;  </span><br><span class="line">	<span class="keyword">constructor</span>(props) &#123;</span><br><span class="line">		<span class="keyword">super</span>(props);</span><br><span class="line">	&#125;</span><br><span class="line">	handleClick() &#123;</span><br><span class="line">		<span class="built_in">console</span>.log(<span class="keyword">this</span>); <span class="comment">// null</span></span><br><span class="line">	&#125;</span><br><span class="line">	render() &#123;</span><br><span class="line">		<span class="keyword">return</span> (</span><br><span class="line">			&lt;div onClick=&#123;<span class="keyword">this</span>.handleClick&#125;&gt;&lt;/div&gt;</span><br><span class="line">		);</span><br><span class="line">	&#125;</span><br><span class="line"> &#125;</span><br></pre></td></tr></table></figure></p>
<p>  <code>React.Component</code>有三种手动绑定方法：可以在构造函数中完成绑定，也可以在调用时使用<code>method.bind(this)</code>来完成绑定，还可以使用Arrow Function(箭头函数)来绑定。<br>    <figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">constructor</span>(props) &#123;</span><br><span class="line">	 <span class="keyword">super</span>(props);</span><br><span class="line">	 <span class="keyword">this</span>.handleClick = <span class="keyword">this</span>.handleClick.bind(<span class="keyword">this</span>); <span class="comment">//构造函数中绑定</span></span><br><span class="line"> &#125;</span><br></pre></td></tr></table></figure></p>
<p>  <code>&lt;div onClick={this.handleClick.bind(this)}&gt;&lt;/div&gt;   //使用bind来绑定</code></p>
<p>  <code>&lt;div onClick={()=&gt;this.handleClick()}&gt;&lt;/div&gt;        //使用Arrow Function来绑定</code></p>
<h4 id="组件初始状态state的配置不同"><a href="#组件初始状态state的配置不同" class="headerlink" title="组件初始状态state的配置不同"></a>组件初始状态<code>state</code>的配置不同</h4><p>  <code>React.createClass</code>创建的组件，其状态<code>state</code>是通过<code>getInitialState</code>方法来配置组件相关的状态。<br>    <figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">const</span> Clazz = React.createClass(&#123;</span><br><span class="line">   <span class="comment">// return an object</span></span><br><span class="line">   getInitialState()&#123; </span><br><span class="line">		<span class="keyword">return</span> &#123;</span><br><span class="line">			isEditing: <span class="literal">false</span></span><br><span class="line">		&#125;</span><br><span class="line">   &#125;</span><br><span class="line">   render()&#123;</span><br><span class="line">     <span class="keyword">return</span> &lt;div&gt;&lt;/div&gt;</span><br><span class="line">   &#125;</span><br><span class="line"> &#125;)</span><br></pre></td></tr></table></figure></p>
<p>  <code>React.Component</code>创建的组件，其状态<code>state</code>是在<code>constructor</code>中像初始化组件属性一样声明的。<br>  <figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line"><span class="class"><span class="keyword">class</span> <span class="title">Clazz</span> <span class="keyword">extends</span> <span class="title">React</span>.<span class="title">Component</span></span>&#123;</span><br><span class="line">  <span class="keyword">constructor</span>(props)&#123;</span><br><span class="line">	<span class="keyword">super</span>(props);</span><br><span class="line">	<span class="keyword">this</span>.state = &#123; <span class="comment">// define this.state in constructor</span></span><br><span class="line">	  isEditing: <span class="literal">false</span></span><br><span class="line">	&#125; </span><br><span class="line">  &#125;</span><br><span class="line">  render()&#123;</span><br><span class="line">    <span class="keyword">return</span> &lt;div&gt;&lt;/div&gt;</span><br><span class="line">  &#125;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure></p>
<h4 id="组件属性类型propTypes及其属性defaultProps配置不同"><a href="#组件属性类型propTypes及其属性defaultProps配置不同" class="headerlink" title="组件属性类型propTypes及其属性defaultProps配置不同"></a>组件属性类型<code>propTypes</code>及其属性<code>defaultProps</code>配置不同</h4><p>  <code>React.createClass</code>在创建组件时，有关组件<code>props</code>的属性类型及组件默认的属性会作为<strong>组件实例的属性</strong>来配置，其中<code>defaultProps</code>是使用<code>getDefaultProps</code>的方法来获取默认组件属性的。<br>  <figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">const</span> Clazz = React.createClass(&#123;</span><br><span class="line">  propTypes: &#123;                       <span class="comment">// as an object</span></span><br><span class="line">    name: React.PropTypes.string</span><br><span class="line">  &#125;,</span><br><span class="line">  getDefaultProps()&#123;                 <span class="comment">// return a object</span></span><br><span class="line">	<span class="keyword">return</span> &#123;</span><br><span class="line">		name: <span class="string">''</span>    </span><br><span class="line">	&#125;</span><br><span class="line">  &#125;</span><br><span class="line">  render()&#123;</span><br><span class="line">    <span class="keyword">return</span> &lt;div&gt;&lt;/div&gt;</span><br><span class="line">  &#125;</span><br><span class="line">&#125;)</span><br></pre></td></tr></table></figure></p>
<p>  <code>React.Component</code>在创建组件时配置这两个对应信息时，他们是作为组件类的属性，<strong>不是组件实例的属性</strong>，也就是所谓的类的静态属性来配置的。<br>  <figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br></pre></td><td class="code"><pre><span class="line"><span class="class"><span class="keyword">class</span> <span class="title">TodoItem</span> <span class="keyword">extends</span> <span class="title">React</span>.<span class="title">Component</span> </span>&#123;</span><br><span class="line">  <span class="keyword">static</span> propTypes = &#123;               <span class="comment">//类的静态属性</span></span><br><span class="line">    name: React.PropTypes.string</span><br><span class="line">  &#125;;</span><br><span class="line">  <span class="keyword">static</span> defaultProps = &#123;            <span class="comment">//类的静态属性</span></span><br><span class="line">    name: <span class="string">''</span></span><br><span class="line">  &#125;;</span><br><span class="line"></span><br><span class="line">  ...</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure></p>

          
        
      
    </div>
    
    
    

    

    

    

    <footer class="post-footer">
      

      

      

      
      
        <div class="post-eof"></div>
      
    </footer>
  </div>
  
  
  
  </article>


    
      

  

  
  
  

  <article class="post post-type-normal" itemscope="" itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="http://yoursite.com/2018/12/04/ServerlessDemo1/">

    <span hidden itemprop="author" itemscope="" itemtype="http://schema.org/Person">
      <meta itemprop="name" content="Roc">
      <meta itemprop="description" content="">
      <meta itemprop="image" content="/images/default_avatar.png">
    </span>

    <span hidden itemprop="publisher" itemscope="" itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Blog">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">
                
                <a class="post-title-link" href="/2018/12/04/ServerlessDemo1/" itemprop="url">一个 Serverless offline +　Aws Dynamodb local Demo</a></h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">Posted on</span>
              
              <time title="Post created" itemprop="dateCreated datePublished" datetime="2018-12-04T10:48:49+08:00">
                2018-12-04
              </time>
            

            

            
          </span>

          

          
            
          

          
          

          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        
          
            <h2 id="从无极而太极，无服务即是服务"><a href="#从无极而太极，无服务即是服务" class="headerlink" title="从无极而太极，无服务即是服务"></a>从无极而太极，无服务即是服务</h2><ul>
<li><a href="https://www.aliyun.com/jiaocheng/525961.html">Serverless</a>是什么，国内外云计算大厂提供相关技术架构和服务，如 WS Lambda，Azure Functions，Google Cloud Functions，IBM Cloud Functions，阿里云的函数计算等，还有为特定用例提供服务的小型供应商, 例如 Twilio Functions、 PubNub Functions、 Auth0 Webtask。还有一些使用 Docker 和 Kubernetes 构建的 serverless 计算实现，例如 Kubeless 和 Fission。</li>
<li><a href="https://serverless.com/">Serverless官网</a></li>
<li><a href="https://github.com/serverless/serverless">Serverless Framework Github</a></li>
</ul>
<p>本地环境：Win7，Git，Nodejs(npm)</p>
<h4 id="1-安装全局-serverless-framework"><a href="#1-安装全局-serverless-framework" class="headerlink" title="1.安装全局 serverless framework"></a>1.安装全局 serverless framework</h4><pre><code>npm install -g serverless
</code></pre><p>安装完验证一下</p>
<pre><code>serverless -v
</code></pre><h4 id="2-设置-aws-凭证"><a href="#2-设置-aws-凭证" class="headerlink" title="2.设置 aws 凭证"></a>2.设置 aws 凭证</h4><p>我这里没有aws账号，暂且用官方的示例：<a href="https://docs.aws.amazon.com/zh_cn/IAM/latest/UserGuide/id_credentials_temp_use-resources.html">临时安全凭证</a><br>将其导入到本地</p>
<pre><code>serverless config credentials --provider aws --key AKIAIOSFODNN7EXAMPLE --secret wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
</code></pre><p>将会自动生成配置到用户目录下 ~/.aws/credentials</p>
<p>下面先下载官方Demo在本地配置跑一下</p>
<h4 id="3-下载aws-node-rest-api-with-dynamodb-and-offline"><a href="#3-下载aws-node-rest-api-with-dynamodb-and-offline" class="headerlink" title="3.下载aws-node-rest-api-with-dynamodb-and-offline"></a>3.下载<a href="https://github.com/serverless/examples/tree/master/aws-node-rest-api-with-dynamodb-and-offline">aws-node-rest-api-with-dynamodb-and-offline</a></h4><pre><code>serverless install -u https://github.com/serverless/examples/tree/master/aws-node-rest-api-with-dynamodb-and-offline -n aws-node-rest-api-with-dynamodb-and-offline
</code></pre><h4 id="4-安装必要依赖"><a href="#4-安装必要依赖" class="headerlink" title="4.安装必要依赖"></a>4.安装必要依赖</h4><pre><code>cd aws-node-rest-api-with-dynamodb-and-offline
npm install
</code></pre><p><img src="/2018/12/04/ServerlessDemo1/1.jpg" alt="1"></p>
<h4 id="5-安装-aws-dynamodb"><a href="#5-安装-aws-dynamodb" class="headerlink" title="5.安装 aws dynamodb"></a>5.安装 aws dynamodb</h4><pre><code>serverless dynamodb install
</code></pre><h4 id="6-启动本地离线服务"><a href="#6-启动本地离线服务" class="headerlink" title="6.启动本地离线服务"></a>6.启动本地离线服务</h4><pre><code>serverless offline start
</code></pre><p><img src="/2018/12/04/ServerlessDemo1/2.jpg" alt="2"></p>
<h4 id="7-另外打开一个GitBash，迁移数据，这一步不执行也行，因为会报-Serverless-DynamoDB-Warn-table-aws-node-rest-api-with-dynamodb-and-offline-dev-already-exists"><a href="#7-另外打开一个GitBash，迁移数据，这一步不执行也行，因为会报-Serverless-DynamoDB-Warn-table-aws-node-rest-api-with-dynamodb-and-offline-dev-already-exists" class="headerlink" title="7.另外打开一个GitBash，迁移数据，这一步不执行也行，因为会报 Serverless: DynamoDB - Warn - table aws-node-rest-api-with-dynamodb-and-offline-dev already exists"></a>7.另外打开一个GitBash，迁移数据，这一步不执行也行，因为会报 <code>Serverless: DynamoDB - Warn - table aws-node-rest-api-with-dynamodb-and-offline-dev already exists</code></h4><pre><code>serverless dynamodb migrate
</code></pre><h4 id="8-打开浏览器地址栏输入-http-localhost-8000-shell-就可以看到DynamoDB-JavaScript-Shell"><a href="#8-打开浏览器地址栏输入-http-localhost-8000-shell-就可以看到DynamoDB-JavaScript-Shell" class="headerlink" title="8.打开浏览器地址栏输入 http://localhost:8000/shell/ 就可以看到DynamoDB JavaScript Shell"></a>8.打开浏览器地址栏输入 <code>http://localhost:8000/shell/</code> 就可以看到DynamoDB JavaScript Shell</h4><p><img src="/2018/12/04/ServerlessDemo1/3.jpg" alt="3"></p>
<p>在控制台输入 <code>tutorial.start()</code> 可以漫游Dynamodb基本操作<br><img src="/2018/12/04/ServerlessDemo1/4.jpg" alt="4"></p>
<h4 id="9-浏览器地址栏输入-http-localhost-3000-todos-请求到的是空json对象"><a href="#9-浏览器地址栏输入-http-localhost-3000-todos-请求到的是空json对象" class="headerlink" title="9.浏览器地址栏输入 http://localhost:3000/todos 请求到的是空json对象"></a>9.浏览器地址栏输入 <code>http://localhost:3000/todos</code> 请求到的是空json对象</h4><p><img src="/2018/12/04/ServerlessDemo1/5.jpg" alt="5"></p>
<p>控制台输出红圈响应：</p>
<p><img src="/2018/12/04/ServerlessDemo1/6.jpg" alt="6"></p>
<h4 id="10-下面通过-curl插入一条数据"><a href="#10-下面通过-curl插入一条数据" class="headerlink" title="10.下面通过 curl插入一条数据"></a>10.下面通过 curl插入一条数据</h4><p><img src="/2018/12/04/ServerlessDemo1/7.jpg" alt="7"></p>
<p>控制台输出响应：</p>
<p><img src="/2018/12/04/ServerlessDemo1/8.jpg" alt="8"></p>
<p>重复第9步，浏览器输出数据：</p>
<p><img src="/2018/12/04/ServerlessDemo1/9.jpg" alt="9"></p>
<h4 id="11-通过火狐插件-HttpRequester插件再插入一条数据"><a href="#11-通过火狐插件-HttpRequester插件再插入一条数据" class="headerlink" title="11.通过火狐插件 HttpRequester插件再插入一条数据"></a>11.通过火狐插件 HttpRequester插件再插入一条数据</h4><p><img src="/2018/12/04/ServerlessDemo1/10.jpg" alt="10"></p>
<p>控制台输出响应：</p>
<p><img src="/2018/12/04/ServerlessDemo1/11.jpg" alt="11"></p>
<p>重复第9步，浏览器输出数据：</p>
<p><img src="/2018/12/04/ServerlessDemo1/12.jpg" alt="12"></p>

          
        
      
    </div>
    
    
    

    

    

    

    <footer class="post-footer">
      

      

      

      
      
        <div class="post-eof"></div>
      
    </footer>
  </div>
  
  
  
  </article>


    
      

  

  
  
  

  <article class="post post-type-normal" itemscope="" itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="http://yoursite.com/2018/11/30/OutlookAutoForwardSettings/">

    <span hidden itemprop="author" itemscope="" itemtype="http://schema.org/Person">
      <meta itemprop="name" content="Roc">
      <meta itemprop="description" content="">
      <meta itemprop="image" content="/images/default_avatar.png">
    </span>

    <span hidden itemprop="publisher" itemscope="" itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Blog">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">
                
                <a class="post-title-link" href="/2018/11/30/OutlookAutoForwardSettings/" itemprop="url">设置Outlook邮件 自动转发</a></h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">Posted on</span>
              
              <time title="Post created" itemprop="dateCreated datePublished" datetime="2018-11-30T15:02:18+08:00">
                2018-11-30
              </time>
            

            

            
          </span>

          

          
            
          

          
          

          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        
          
            <h3 id="设置Outlook邮件-自动转发"><a href="#设置Outlook邮件-自动转发" class="headerlink" title="设置Outlook邮件 自动转发"></a>设置Outlook邮件 自动转发</h3><ol>
<li><p>Tools —&gt; Rules and Alerts<br><img src="/2018/11/30/OutlookAutoForwardSettings/1.jpg" alt="Rules and Alerts"></p>
</li>
<li><p>NewRule<br><img src="/2018/11/30/OutlookAutoForwardSettings/2.jpg" alt="NewRule"></p>
</li>
<li><p>Start from a blank rule —&gt; Check the messages when they arrive<br><img src="/2018/11/30/OutlookAutoForwardSettings/3.jpg" alt="Start from a blank rule"></p>
</li>
<li><p>Next<br><img src="/2018/11/30/OutlookAutoForwardSettings/4.jpg" alt="Next"></p>
</li>
<li><p>from people or distribution list<br><img src="/2018/11/30/OutlookAutoForwardSettings/5.jpg" alt="from people or distribution list"></p>
</li>
<li><p>Add From Address list<br><img src="/2018/11/30/OutlookAutoForwardSettings/7.jpg" alt="Add From list"></p>
</li>
<li><p>Next<br><img src="/2018/11/30/OutlookAutoForwardSettings/6.jpg" alt="Next"></p>
</li>
<li><p>Check the [forward it to people or distribution list]<br><img src="/2018/11/30/OutlookAutoForwardSettings/8.jpg" alt="forward it to people or distribution list"></p>
</li>
<li><p>Set to Address<br><img src="/2018/11/30/OutlookAutoForwardSettings/9.jpg" alt="Set to"></p>
</li>
<li><p>Set exceptions<br><img src="/2018/11/30/OutlookAutoForwardSettings/10.jpg" alt="Set exceptions"></p>
</li>
<li><p>Finish set a name and turn on<br><img src="/2018/11/30/OutlookAutoForwardSettings/11.jpg" alt="Finish"></p>
</li>
</ol>

          
        
      
    </div>
    
    
    

    

    

    

    <footer class="post-footer">
      

      

      

      
      
        <div class="post-eof"></div>
      
    </footer>
  </div>
  
  
  
  </article>


    
      

  

  
  
  

  <article class="post post-type-normal" itemscope="" itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="http://yoursite.com/2018/11/23/A-Blog/">

    <span hidden itemprop="author" itemscope="" itemtype="http://schema.org/Person">
      <meta itemprop="name" content="Roc">
      <meta itemprop="description" content="">
      <meta itemprop="image" content="/images/default_avatar.png">
    </span>

    <span hidden itemprop="publisher" itemscope="" itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Blog">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">
                
                <a class="post-title-link" href="/2018/11/23/A-Blog/" itemprop="url">Markdown Info</a></h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">Posted on</span>
              
              <time title="Post created" itemprop="dateCreated datePublished" datetime="2018-11-23T09:45:50+08:00">
                2018-11-23
              </time>
            

            

            
          </span>

          

          
            
          

          
          

          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        
          
            <h2 id="Markdown-编辑器"><a href="#Markdown-编辑器" class="headerlink" title="Markdown 编辑器"></a>Markdown 编辑器</h2><h3 id="MdEditor"><a href="#MdEditor" class="headerlink" title="MdEditor"></a><a href="https://www.mdeditor.com/">MdEditor</a></h3><blockquote>
<p><img src="https://www.mdeditor.com/images/logos/markdown.png" alt="cmd-markdown-logo"></p>
</blockquote>
<h3 id="Cmd-Markdown-编辑阅读器"><a href="#Cmd-Markdown-编辑阅读器" class="headerlink" title="Cmd Markdown 编辑阅读器"></a><a href="https://www.zybuluo.com/mdeditor">Cmd Markdown 编辑阅读器</a></h3><blockquote>
<p><img src="https://www.zybuluo.com/static/img/logo.png" alt="cmd-markdown-logo"><br>除了您现在看到的这个 Cmd Markdown 在线版本，您还可以前往以下网址下载：<br><a href="https://www.zybuluo.com/cmd/#bloc-8">Windows/Mac/Linux 全平台客户端</a></p>
</blockquote>
<h3 id="Typora"><a href="#Typora" class="headerlink" title="Typora"></a><a href="https://www.typora.io/">Typora</a></h3><blockquote>
<p>[下载]（<a href="https://www.typora.io/#download">https://www.typora.io/#download</a>)            </p>
</blockquote>
<h3 id="小书匠编辑器"><a href="#小书匠编辑器" class="headerlink" title="小书匠编辑器"></a><a href="http://markdown.xiaoshujiang.com/">小书匠编辑器</a></h3><blockquote>
<p><a href="http://soft.xiaoshujiang.com/download.html">离线版下载地址</a><br><a href="https://github.com/suziwen/markdownxiaoshujiang/releases/tag/v6.7.0">GitHub</a></p>
</blockquote>
<h3 id="Dillinger"><a href="#Dillinger" class="headerlink" title="Dillinger"></a><a href="https://dillinger.io/">Dillinger</a></h3><h3 id="马克飞象"><a href="#马克飞象" class="headerlink" title="马克飞象"></a><a href="https://maxiang.io/">马克飞象</a></h3><blockquote>
<p><img src="https://maxiang.io/ico/icon128.png" alt="cmd-markdown-logo"></p>
</blockquote>
<h3 id="Editor"><a href="#Editor" class="headerlink" title="Editor"></a><a href="http://pandao.github.io/editor.md/">Editor</a></h3><blockquote>
<p><img src="https://pandao.github.io/editor.md/images/logos/editormd-logo-180x180.png" alt="cmd-markdown-logo"></p>
</blockquote>
<h3 id="数学公式"><a href="#数学公式" class="headerlink" title="数学公式"></a><a href="https://math.meta.stackexchange.com/questions/5020/mathjax-basic-tutorial-and-quick-reference">数学公式</a></h3><blockquote>
<p><a href="https://mathjax-chinese-doc.readthedocs.io/en/latest/index.html">MathJax 中文文档</a><br><a href="http://www.ctex.org/OnlineDocuments">Latex 文档</a><br><a href="http://ipython.org/notebook">IPython</a></p>
</blockquote>
<ul>
<li><a href="https://blog.csdn.net/u014630987/article/details/78670258">参考1</a></li>
<li><a href="https://www.jianshu.com/p/7ab21c7f0674">参考2</a></li>
<li><p><a href="https://blog.csdn.net/whqet/article/details/44277965">参考3</a></p>
<p><strong>Sample:</strong> </p>
<script type="math/tex; mode=display">E=mc^2</script><p><strong>LaTeX 公式</strong></p>
<p>可以创建行内公式，例如 $\Gamma(n) = (n-1)!\quad\forall n\in\mathbb N$。或者块级公式：</p>
<script type="math/tex; mode=display">x = \dfrac{-b \pm \sqrt{b^2 - 4ac}}{2a}</script></li>
</ul>
<h3 id="流程图"><a href="#流程图" class="headerlink" title="流程图"></a>流程图</h3><p>  <a href="https://github.com/bubkoo/hexo-filter-flowchart">Hexo-filter-flowchart</a></p>
<ul>
<li><p><a href="https://cloud.tencent.com/developer/article/1142260">参考1</a></p>
<p><a href="https://github.com/knsv/mermaid">Hexo-filter-mermaid-diagrams</a></p>
</li>
<li><a href="https://www.liuyude.com/How_to_make_your_HEXO_blog_support_handwriting_flowchart.html">参考2</a></li>
<li><a href="https://mermaidjs.github.io/flowchart.html">参考3</a></li>
<li><p><a href="https://mermaidjs.github.io/sequenceDiagram.html">参考4</a></p>
<p><strong>Sample:</strong> </p>
<div id="flowchart-0" class="flow-chart"></div>


</li>
</ul>
<h3 id="5-高效绘制-序列图"><a href="#5-高效绘制-序列图" class="headerlink" title="5. 高效绘制 序列图"></a>5. 高效绘制 <a href="https://www.zybuluo.com/mdeditor?url=https://www.zybuluo.com/static/editor/md-help.markdown#8-序列图">序列图</a></h3><p>  <a href="https://github.com/bubkoo/hexo-filter-sequence">Hexo-filter-sequence</a></p>
<ul>
<li><p><a href="https://mermaidjs.github.io/sequenceDiagram.html">参考</a></p>
<p><strong>Sample:</strong> </p>
<div id="sequence-0"></div>

</li>
</ul>
<div id="sequence-1"></div>

<div id="sequence-2"></div>


<h3 id="7-绘制表格"><a href="#7-绘制表格" class="headerlink" title="7. 绘制表格"></a>7. 绘制表格</h3><div class="table-container">
<table>
<thead>
<tr>
<th>项目</th>
<th style="text-align:right">价格</th>
<th style="text-align:center">数量</th>
</tr>
</thead>
<tbody>
<tr>
<td>计算机</td>
<td style="text-align:right">$1600</td>
<td style="text-align:center">5</td>
</tr>
<tr>
<td>手机</td>
<td style="text-align:right">$12</td>
<td style="text-align:center">12</td>
</tr>
<tr>
<td>管线</td>
<td style="text-align:right">$1</td>
<td style="text-align:center">234</td>
</tr>
</tbody>
</table>
</div>
<h3 id="代码高亮"><a href="#代码高亮" class="headerlink" title="代码高亮"></a><a href="https://github.com/ele828/hexo-prism-plugin">代码高亮</a></h3><p><a href="https://blog.csdn.net/u011240016/article/details/79422448">参考1</a><br><a href="https://www.ieclipse.cn/en/2016/08/10/Web/hexo-filter-highlight/index.html">参考2</a><br><a href="https://jmblog.github.io/color-themes-for-google-code-prettify/">参考3</a><br><a href="https://liuzhichao.com/2016/hexo-use-prettify-to-highlight-code.html">参考4</a></p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">@requires_authorization</span></span><br><span class="line"><span class="class"><span class="keyword">class</span> <span class="title">SomeClass</span>:</span></span><br><span class="line">    <span class="keyword">pass</span></span><br><span class="line"></span><br><span class="line"><span class="keyword">if</span> __name__ == <span class="string">'__main__'</span>:</span><br><span class="line">    <span class="comment"># A comment</span></span><br><span class="line">    <span class="keyword">print</span> <span class="string">'hello world'</span></span><br></pre></td></tr></table></figure>
<h3 id="我是分割线"><a href="#我是分割线" class="headerlink" title="我是分割线"></a>我是分割线</h3><hr>
<hr>
<p><a href="https://www.cnblogs.com/hnrainll/p/3514637.html">Other</a></p>
<!-- 
### 复选框

使用 `- [ ]` 和 `- [x]` 语法可以创建复选框，实现 todo-list 等功能。例如：

- [x] 已完成事项
- [x] 待办事项1
- [x] 待办事项2`- [ ]`
ballot box (empty, that ’ s how it ’ s supposed to be)
<input type='checkbox' onclick='return false;' checked> bla bla
<input type='checkbox' > bla blafffd -->
<p><script src="https://cdnjs.cloudflare.com/ajax/libs/raphael/2.2.7/raphael.min.js"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/flowchart/1.6.5/flowchart.min.js"></script><textarea id="flowchart-0-code" style="display: none">#注释
st=>start: Start:>http://www.baidu.com[blank]
e=>end:>http://www.baidu.com
op1=>operation: My Operation
sub1=>subroutine: My Subroutine
cond=>condition: Yes
or No?:>http://www.baidu.com
io=>inputoutput: catch something...

st->op1->cond
cond(yes)->io->e
cond(no)->sub1(right)->op1</textarea><textarea id="flowchart-0-options" style="display: none">{"theme":"simple","scale":1,"line-width":2,"line-length":50,"text-margin":10,"font-size":12}</textarea><script>  var code = document.getElementById("flowchart-0-code").value;  var options = JSON.parse(decodeURIComponent(document.getElementById("flowchart-0-options").value));  var diagram = flowchart.parse(code);  diagram.drawSVG("flowchart-0", options);</script><script src="https://cdnjs.cloudflare.com/ajax/libs/webfont/1.6.27/webfontloader.js"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/snap.svg/0.4.1/snap.svg-min.js"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore-min.js"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/js-sequence-diagrams/1.0.6/sequence-diagram-min.js"></script><textarea id="sequence-0-code" style="display: none">Alice->Bob: Hello Bob, how are you?
Note right of Bob: Bob thinks
Bob-->Alice: I am good thanks!</textarea><textarea id="sequence-0-options" style="display: none">{"theme":"simple","scale":1,"line-width":2,"line-length":50,"text-margin":10,"font-size":12}</textarea><script>  var code = document.getElementById("sequence-0-code").value;  var options = JSON.parse(decodeURIComponent(document.getElementById("sequence-0-options").value));  var diagram = Diagram.parse(code);  diagram.drawSVG("sequence-0", options);</script><textarea id="sequence-1-code" style="display: none">Title:AXI_interface序列图参照物
AXI_Master1->AXI_slaver: 请求(valid)\n awvalid/arvalid
AXI_slaver->AXI_Master1: 握手(ready)  \nawready/arready
AXI_slaver->AXI_Master1: 读返回(rdata)\n rvalid
AXI_Master2->AXI_slaver: 请求(valid)\n awvalid/arvalid
AXI_slaver->AXI_Master2: 握手(ready)\n awready/arready
AXI_slaver->AXI_Master2: 读返回(rdata)\n rvalid</textarea><textarea id="sequence-1-options" style="display: none">{"theme":"simple","scale":1,"line-width":2,"line-length":50,"text-margin":10,"font-size":12}</textarea><script>  var code = document.getElementById("sequence-1-code").value;  var options = JSON.parse(decodeURIComponent(document.getElementById("sequence-1-options").value));  var diagram = Diagram.parse(code);  diagram.drawSVG("sequence-1", options);</script><textarea id="sequence-2-code" style="display: none">Title:序列图虚线和箭头
AXI_Master3-->>AXI_slaver1: 请求(valid)\n awvalid/arvalid
AXI_slaver1-->AXI_Master3: 握手(ready)  awready/arready
AXI_slaver1->AXI_Master3: 读返回(rdata)\n rvalid</textarea><textarea id="sequence-2-options" style="display: none">{"theme":"simple","scale":1,"line-width":2,"line-length":50,"text-margin":10,"font-size":12}</textarea><script>  var code = document.getElementById("sequence-2-code").value;  var options = JSON.parse(decodeURIComponent(document.getElementById("sequence-2-options").value));  var diagram = Diagram.parse(code);  diagram.drawSVG("sequence-2", options);</script></p>

          
        
      
    </div>
    
    
    

    

    

    

    <footer class="post-footer">
      

      

      

      
      
        <div class="post-eof"></div>
      
    </footer>
  </div>
  
  
  
  </article>


    
      

  

  
  
  

  <article class="post post-type-normal" itemscope="" itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="http://yoursite.com/2018/11/22/hello-world/">

    <span hidden itemprop="author" itemscope="" itemtype="http://schema.org/Person">
      <meta itemprop="name" content="Roc">
      <meta itemprop="description" content="">
      <meta itemprop="image" content="/images/default_avatar.png">
    </span>

    <span hidden itemprop="publisher" itemscope="" itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Blog">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">
                
                <a class="post-title-link" href="/2018/11/22/hello-world/" itemprop="url">Hello World</a></h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">Posted on</span>
              
              <time title="Post created" itemprop="dateCreated datePublished" datetime="2018-11-22T17:22:43+08:00">
                2018-11-22
              </time>
            

            

            
          </span>

          

          
            
          

          
          

          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        
          
            <p>Welcome to <a href="https://hexo.io/">Hexo</a>! This is your very first post. Check <a href="https://hexo.io/docs/">documentation</a> for more info. If you get any problems when using Hexo, you can find the answer in <a href="https://hexo.io/docs/troubleshooting.html">troubleshooting</a> or you can ask me on <a href="https://github.com/hexojs/hexo/issues">GitHub</a>.</p>
<h2 id="Quick-Start"><a href="#Quick-Start" class="headerlink" title="Quick Start"></a>Quick Start</h2><h3 id="Create-a-new-post"><a href="#Create-a-new-post" class="headerlink" title="Create a new post"></a>Create a new post</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo new <span class="string">"My New Post"</span></span><br></pre></td></tr></table></figure>
<p>More info: <a href="https://hexo.io/docs/writing.html">Writing</a></p>
<h3 id="Run-server"><a href="#Run-server" class="headerlink" title="Run server"></a>Run server</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo server</span><br></pre></td></tr></table></figure>
<p>the same cmd is:<br><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo s</span><br></pre></td></tr></table></figure></p>
<p>Change the port<br><figure class="highlight stylus"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">hexo s -<span class="selector-tag">p</span> <span class="number">4001</span></span><br></pre></td></tr></table></figure></p>
<p>More info: <a href="https://hexo.io/docs/server.html">Server</a></p>
<h3 id="Generate-static-files"><a href="#Generate-static-files" class="headerlink" title="Generate static files"></a>Generate static files</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo generate</span><br></pre></td></tr></table></figure>
<p>the same cmd is:<br><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo g</span><br></pre></td></tr></table></figure></p>
<h4 id="Watch-for-File-Changes"><a href="#Watch-for-File-Changes" class="headerlink" title="Watch for File Changes"></a>Watch for File Changes</h4><blockquote>
<p>Hexo can watch for file changes and regenerate files immediately. Hexo will compare the SHA1 checksum of your files and only write if file changes are detected.<br>    <figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo generate --watch</span><br></pre></td></tr></table></figure></p>
</blockquote>
<p>  More info: <a href="https://hexo.io/docs/generating.html">Generating</a></p>
<h3 id="Deploy-to-remote-sites"><a href="#Deploy-to-remote-sites" class="headerlink" title="Deploy to remote sites"></a>Deploy to remote sites</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo deploy</span><br></pre></td></tr></table></figure>
<p>the same cmd is:<br><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo d</span><br></pre></td></tr></table></figure></p>
<p>More info: <a href="https://hexo.io/docs/deployment.html">Deployment</a></p>
<h3 id="Cleans-the-cache-file-db-json-and-generated-files-public"><a href="#Cleans-the-cache-file-db-json-and-generated-files-public" class="headerlink" title="Cleans the cache file (db.json) and generated files (public)."></a>Cleans the cache file (db.json) and generated files (public).</h3><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">$ hexo clean</span><br></pre></td></tr></table></figure>
<p>More info: <a href="https://hexo.io/docs/commands#clean">Deployment</a></p>
<p><a href="https://www.simon96.online/2018/11/10/hexo-env/">Hexo-Env</a><br><a href="https://hexo.io/zh-cn/">中文文档</a><br><img src="https://hexo.io/icon/favicon-196x196.png" alt="cmd-markdown-logo"></p>

          
        
      
    </div>
    
    
    

    

    

    

    <footer class="post-footer">
      

      

      

      
      
        <div class="post-eof"></div>
      
    </footer>
  </div>
  
  
  
  </article>


    
  </section>

  


          </div>
          


          

        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    
    <div class="sidebar-inner">

      

      

      <section class="site-overview-wrap sidebar-panel sidebar-panel-active">
        <div class="site-overview">
          <div class="site-author motion-element" itemprop="author" itemscope="" itemtype="http://schema.org/Person">
            
              <img class="site-author-image" itemprop="image" src="/images/default_avatar.png" alt="Roc">
            
              <p class="site-author-name" itemprop="name">Roc</p>
              <p class="site-description motion-element" itemprop="description"></p>
          </div>

          <nav class="site-state motion-element">

            
              <div class="site-state-item site-state-posts">
              
                <a href="/archives/">
              
                  <span class="site-state-item-count">7</span>
                  <span class="site-state-item-name">posts</span>
                </a>
              </div>
            

            

            

          </nav>

          

          
            <div class="links-of-author motion-element">
                
                  <span class="links-of-author-item">
                    <a href="https://github.com/RocGit" target="_blank" title="GitHub">
                      
                        <i class="fa fa-fw fa-github"></i>GitHub</a>
                  </span>
                
            </div>
          

          
          

          
          

          

        </div>
      </section>

      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright">&copy; <span itemprop="copyrightYear">2019</span>
  <span class="with-love">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Roc</span>

  
</div>


  <div class="powered-by">Powered by <a class="theme-link" target="_blank" href="https://hexo.io">Hexo</a></div>



  <span class="post-meta-divider">|</span>



  <div class="theme-info">Theme &mdash; <a class="theme-link" target="_blank" href="https://github.com/iissnan/hexo-theme-next">NexT.Muse</a> v5.1.4</div>





  <span class="post-meta-divider">|</span>


<script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
<span id="busuanzi_container_site_pv" title="总访问量">
  <i class="fa fa-line-chart"></i>
  <span id="busuanzi_value_site_pv"></span>
	<a class="theme-link" target="_blank" href="https://busuanzi.ibruce.info/">
	  <i class="fa fa-users" aria-hidden="true"></i>
	</a>
</span>


  <script src="https://unpkg.com/mermaid@7.1.2/dist/mermaid.min.js"></script>
  <script>
    if (window.mermaid) {
      mermaid.initialize({theme: 'forest'});
    }
  </script>

        







        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  












  
  
    <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>
  

  
  
    <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>
  

  
  
    <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>
  


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.4"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.4"></script>



  
  

  

  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.4"></script>



  


  




	





  





  












  





  

  

  

  
  

  
  
    <script type="text/x-mathjax-config">
      MathJax.Hub.Config({
        tex2jax: {
          inlineMath: [ ['$','$'], ["\\(","\\)"]  ],
          processEscapes: true,
          skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code']
        }
      });
    </script>

    <script type="text/x-mathjax-config">
      MathJax.Hub.Queue(function() {
        var all = MathJax.Hub.getAllJax(), i;
        for (i=0; i < all.length; i += 1) {
          all[i].SourceElement().parentNode.className += ' has-jax';
        }
      });
    </script>
    <script type="text/javascript" src="//cdn.bootcss.com/mathjax/2.7.1/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
  


  

  

<script src="/live2dw/lib/L2Dwidget.min.js?0c58a1486de42ac6cc1c59c7d98ae887"></script><script>L2Dwidget.init({"model":{"jsonPath":"/live2dw/assets/tororo.model.json"},"display":{"position":"right","width":140,"height":260},"mobile":{"show":true},"log":false,"pluginJsPath":"lib/","pluginModelPath":"assets/","pluginRootPath":"live2dw/","tagMode":false});</script></body>
</html>
